package com.xyf.sys.mapper;

import com.xyf.sys.domain.SysCart;
import com.xyf.sys.domain.SysCartItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface SysCartMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysCart record);

    int insertSelective(SysCart record);

    SysCart selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysCart record);

    int updateByPrimaryKey(SysCart record);

    SysCart findByUserIdAndProductId(@Param("userId") String userId, @Param("productId") Long productId, @Param("status") String status);

    List<SysCart> selectByUserId(@Param("userId") String userId, @Param("status") String status);

    List<SysCart> selectListByIds(@Param("list") List<Long> cartIds);

    SysCart selectUserDefault(@Param("userId") String userId);

    List<SysCart> selectList(@Param("userId") String userId, @Param("type") Integer type);

    List<SysCart> selectByUserIdAndShareCartId(@Param("userId")String userId, @Param("shareCartId")Long shareCartId,@Param("status") String status);

    Integer countCode(@Param("code") String code);

    List<SysCart> selectAll();
}